<?
/*
 * Copyright 2004-2005 Sigve Indregard.
 *
 * This file is part of Laivsys.
 *
 * Laivsys is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Laivsys is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Laivsys; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

/*
 * $Id: rollebeskrivelse.php 6 2005-07-11 23:14:47Z say $
 */
 
require "db.php";
require "normauth.php";
include "admin/rollerinclude.php";
printtop();

$sql="SELECT * FROM Deltakere WHERE ID=".$_SESSION['UserID'];
$rs=mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($rs) == 0)
	die ("No such user!");
else
	$user=mysql_fetch_assoc($rs);

$sql="SELECT * FROM r_Rolle WHERE eierID=".$user['ID'];
$roller=mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($roller) == 0)
	echo "Du er ikke tildelt noen rolle enda.";
else {
	while ($rolle=mysql_fetch_assoc($roller))
		completeRollebeskrivelse($rolle['ID']);
}
printbottom();


function printrow($tittel, $innhold) {
	if (!($innhold=='' || is_null($innhold))) {
		?>
		<tr>
			<th><?=$tittel?></th>
			<td><?=$innhold?></td>
		</tr>
		<?
	}
}

function printtop() {
	?>
	<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
	<html>
	<head>
		<title>Rollebeskrivelse</title>
		<style>
		BODY {
			font-family:	serif;
		}
		TH {
			text-align:	left;
			font-weight:	bold;
		}
		H3 {
			border-bottom: 1px solid black;
		}
		</style>
		<body>
	<?
}

function printbottom() {
	?>
	</body>
	</html>
	<?
}
			
?>
